package main

import (
	"learn-go/18.crawler4/frontend/controller"
	"net/http"
)

func main() {
	// 需要展示css、js文件
	http.Handle("/", http.FileServer(http.Dir("18.crawler4/frontend/view/")))

	//http.Handle("/search", controller.SearchResultHandler{})
	http.Handle("/search", controller.CreateSearchResultHandler("18.crawler4/frontend/view/template.html"))
	err := http.ListenAndServe(":8888", nil)
	if err != nil {
		panic(err)
	}
}
